package main.java.file;

import java.io.File;
import java.io.IOException;

public class CreateNewFileDemo {
    public static void main(String[] args) throws IOException {
        File file = new File("E:\\51_home-work\\homework\\src\\main\\resource\\test02.txt");
        if(file.exists()){
            System.out.println("文件已存在");
        }else{
            file.createNewFile();
            System.out.println("创建成功");
        }
    }
}
